/*
 * qc slave mode data control.
 * Copyright (c) 2012  everyone
 * All rights reserved.
 * no limite
 */
#include "qcom.h"
#define _MBDATACB_MODULE_
#include "mb_box_input.h"
#include "sys_task.h"

/*******************************************************************************
 * @brief  arg
 *****************************************************************************/
static uu08 text_change = 0;
static uu08 prog_page = 0;
static uu08 prog_page_size = 128;

/*******************************************************************************
 * @brief  function
 *****************************************************************************/
void box_qc_reg_prog_opt(uint16_t Val);

/*******************************************************************************
 * @brief  reg_hold_read
 * \param[in] Index : data address
 * @return  data
 * @ Pass/ Fail criteria: none
 *****************************************************************************/
uint16_t box_qc_reg_get(uint16_t Index)
{
	word_tt Val = {0};


	return Val.uVal;
}

/*******************************************************************************
 * @brief  reg_hold_write
 * \param[in] Index : data address
 * \param[in] Val : data
 * @return  data
 * @ Pass/ Fail criteria: none
 *******************************************************************************/
void box_qc_reg_set(uint16_t Index, uint16_t Val)
{


}

/*******************************************************************************
 * @brief  reg_hold_read
 * \param[in] Index : data address
 * @return  data
 * @ Pass/ Fail criteria: none
 *****************************************************************************/
uint16_t box_qc_input_get(uint16_t Index)
{
	word_tt Val;


	return Val.uVal;
}

/*******************************************************************************
 * @brief  reg_coil_write
 * \param[in] Index : data address
 * \param[in] Val : data
 * @return  data
 * @ Pass/ Fail criteria: none
 *******************************************************************************/
uu8 box_coil_reg[16];

void box_qc_coil_dat_set(uu16 Bindex, uu8 dat)
{
	if (Bindex < 16)
		box_coil_reg[Bindex] = dat;
}

/*******************************************************************************
 * @brief  reg_coil_read
 * \param[in] Index : data address
 * @return  data
 * @ Pass/ Fail criteria: none
 *****************************************************************************/
uu8 box_qc_coil_dat_get(uu16 Bindex)
{
	if (Bindex < 16)
		return box_coil_reg[Bindex];
	else
		return 0;
}
